﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="relationships.aspx.cs" Inherits="btnet.pages.relationships" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title id="titl" runat="server">btnet related bugs</title>
<link rel="StyleSheet" href="btnet.css" type="text/css">
<script type="text/javascript" language="JavaScript" src="sortable.js"></script>

<script>

var asp_form_id = '<% Response.Write(Util.get_form_name()); %>';

function remove(bugid2_arg)
{
    var frm =  document.getElementById(asp_form_id)
    var actn = document.getElementById("actn")
    actn.value = "remove"
    document.getElementById("bugid2").value = bugid2_arg
    frm.submit()
}

function body_on_load()
{

	opener.set_relationship_cnt(
	<%
		Response.Write(Convert.ToString(bugid));
		Response.Write(",");
		Response.Write(Convert.ToString(ds.Tables[0].Rows.Count));
	%>
	)
}

</script>
</head>

<body onload="body_on_load()">

<div class=align>
Relationships for 
<% 
    Response.Write(SingularBugLabel 
	+ " " 
	+ Convert.ToString(bugid)); 
%>

<p>
<table border=0><tr><td>

<%
if (permission_level != Security.PERMISSION_READONLY)
{
%>
<p>
<form id="Form1" class=frm runat="server" action="relationships.aspx">
<table>
<tr><td>Related ID:<td><input type="text" class="txt" id="bugid2" name="bugid2" size=8>
<tr><td>Comment:<td><input type="text" class="txt" id="type" name="type" size=90 maxlength=500>

<tr><td colspan=2>
Related ID is sibling<asp:RadioButton runat="server" checked="true" GroupName="direction" value="0" id="siblings"/>
&nbsp;&nbsp;&nbsp;
Related ID is child<asp:RadioButton runat="server" GroupName="direction" value="1" id="child_to_parent"/>
&nbsp;&nbsp;&nbsp;
Related ID is parent<asp:RadioButton runat="server" GroupName="direction" value="2" id="parent_to_child"/>
&nbsp;&nbsp;&nbsp;
<tr><td colspan=2><input class="btn" type="submit" value="Add">
<tr><td colspan=2>&nbsp;
<tr><td colspan=2>&nbsp;<span runat="server" class="err" id="add_err"></span>
</table>
<input runat="server" id="bgid" type=hidden name="bgid" value="">
<input id="actn" type=hidden name="actn" value="add">
<input id="ses" type=hidden name="ses" value="<% Response.Write(ses); %>">

</form>
<% } %>

</td></tr></table>

</p>
<%

if (ds.Tables[0].Rows.Count > 0)
{
	SortableHtmlTable.create_from_dataset(
		Response, ds, "", "", false);

	display_hierarchy();
}
else
{
    Response.Write("No related " + PluralBugLabel);
}

%>
</div>
</body>
</html>
